<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: wjn
 * @LastEditTime: 2022-01-10 18:15:24
-->
<template>
  <div ref="bottom2_container" style="height: 100%"></div>
</template>
<script>
import { get } from "../../../utils/request";
import { Line } from "@antv/g2plot";
import moment from "moment";
export default {
  mounted() {
    this.initData();
  },
  data() {
    return {
      dataArr: [],
    };
  },
  created() {},
  methods: {
    initData() {
      get("http://8.130.15.199:7001/dashboard/queryMouthData", {}).then((res) => {
        this.dataArr = res.data;
        console.log(5555, this.dataArr);
        this.initChart();
      });
    },
    initChart() {
      const line = new Line(this.$refs.bottom2_container, {
        data: this.dataArr,
        xField: "date",
        yField: "value",
        seriesField: "type",
        legend: {
          maxRow:1,
          itemSpacing:5,
          maxHeight:8,
        },
      });

      line.render();
    },
  },
};
</script>